<?php
    $this->head('css', 'assets/slideshow');
    $this->head('js',  'assets/slideshow');

?>
<ul class="slideshow">
<? foreach($slideshow as $slide): ?>
    <li>
        <? if(! empty($slide->title)): ?><h1><?= $slide->title ?></h1><? endif ?>
        <?= $this->img("slideshow/{$slide->image}", $slide->title) ?>
    </li>
<? endforeach ?>
</ul>
<script type="text/javascript">
$(function(){
    $('.slideshow').slideshow();
});
</script>

<? foreach($categories as $category): ?>
<? if (! empty($category->products)): ?>
    <h2><span><?= $this->element('category_breadcrumbs', array('category'=>$category)) ?><?= $this->link($category->name, "/products/index/{$category->id}/" . APP::urlize($category->name)) ?></span></h2>
    <?= $this->element('product_list', array('products' => $category->products)) ?>
<? endif ?>
<? endforeach ?>